import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入vant组件
import Vant from 'vant';
import 'vant/lib/index.css';
//引入Element-Plus图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'




const BASE_URL = 'https://frp-dad.top:36897';//,'https://frp-any.top:26946''https://frp-any.top:26946'
window.BASE_URL = BASE_URL;

// window.setUser = (user) => {
//     localStorage.setItem('user',JSON.stringify(user));
// }
//
// window.getUser = ()=> {
//     request({
//         method: "get",
//         url: BASE_URL+"/v1/user/selectCurrent"
//     }).then(res => {
//         if (res.data.code === 2000) {
//             setUser(res.data.data);
//             currentUser.value = res.data.data
//         }
//     })
//     return localStorage.user?JSON.parse(localStorage.user):null;
// }

const app = createApp(App);
app.use(Vant);

app.use(store).use(router).mount('#app')

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.config.globalProperties.BASE_URL = BASE_URL;

